home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / Vk / VkSubMenu.z / VkSubMenu
Encoding:
Text File  |  2002-10-03  |  14.1 KB  |  331 lines

  1.  
  2.  
  3.  
  4. VVVVkkkkSSSSuuuubbbbMMMMeeeennnnuuuu((((3333xxxx))))                                                    VVVVkkkkSSSSuuuubbbbMMMMeeeennnnuuuu((((3333xxxx))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      VkSubMenu - A container for pulldown or pull-right menu panes
  10.  
  11. IIIINNNNHHHHEEEERRRRIIIITTTTSSSS FFFFRRRROOOOMMMM
  12.      VkMenu : VkMenuItem: VkComponent : VkCallbackObject
  13.  
  14. HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE
  15.      #include <Vk/VkSubMenu.h>
  16.  
  17. PPPPUUUUBBBBLLLLIIIICCCC PPPPRRRROOOOTTTTOOOOCCCCOOOOLLLL SSSSUUUUMMMMMMMMAAAARRRRYYYY
  18.    CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrr////DDDDeeeessssttttrrrruuuuccccttttoooorrrr
  19.            VkSubMenu(const char *name,
  20.                      VkMenuDesc *desc = NULL,
  21.                       XtPointer defaultClientData = NULL);
  22.  
  23.            VkSubMenu(Widget parent,
  24.                       const char *,
  25.                       VkMenuDesc *desc = NULL,
  26.                       XtPointer defaultClientData = NULL);
  27.  
  28.            virtual ~VkSubMenu();
  29.  
  30.  
  31.    TTTTeeeeaaaarrrr OOOOffffffff CCCCoooonnnnttttrrrroooollll
  32.            void showTearOff(Boolean showit);
  33.  
  34.  
  35.    AAAAcccccccceeeessssssss FFFFuuuunnnnccccttttiiiioooonnnnssss
  36.            virtual  VkMenuItemType menuType ();
  37.            Widget  pulldown();
  38.            virtual const char* className();
  39.  
  40.  
  41. CCCCLLLLAAAASSSSSSSS DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  42.      The VkSubMenu class supports pulldown menu panes. These menu panes can be
  43.      used within a menu bar (a VkMenuBar object), or as a cascading, pull-
  44.      right menu in a popup or other pulldown menu.
  45.  
  46.  
  47. MMMMEEEENNNNUUUUSSSS IIIINNNN TTTTHHHHEEEE OOOOVVVVEEEERRRRLLLLAAAAYYYY PPPPLLLLAAAANNNNEEEESSSS
  48.      By default, menus appear in the normal planes.  A ViewKit application's
  49.      menus may be explicitly placed in the deepest available overlay planes.
  50.      Doing so prevents menus from causing expose events and disturbing such
  51.      things as complex GL rendering.  Doing so may also allow better looking
  52.      menus when they contain things like checkmarks.  The current
  53.      implementation is global.  For a single application, either all menus go
  54.      in the overlay planes or none of them do.  That may be relaxed in a
  55.      future release.
  56.  
  57.      There are three ways to enable menus in the overlay planes:
  58.  
  59.           Call VkMenu::useOverlayMenus(TRUE) in your application.  This will
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. VVVVkkkkSSSSuuuubbbbMMMMeeeennnnuuuu((((3333xxxx))))                                                    VVVVkkkkSSSSuuuubbbbMMMMeeeennnnuuuu((((3333xxxx))))
  71.  
  72.  
  73.  
  74.           force all menus to be in the overlay planes, with no way to put them
  75.           back in the normal planes without recompiling.
  76.  
  77.           Put the resource string "*useOverlayMenus: True" in your
  78.           application's app-defaults file.  This will put menus in the overlay
  79.           planes by default, but allow users to use the normal planes by
  80.           changing their .Xdefaults file.
  81.  
  82.           Ask the user to add the "-useOverlayMenus" command line switch when
  83.           they run your application.  This will put menus in the normal planes
  84.           by default, but allow the user to explicitly ask that the overlay
  85.           planes be used.
  86.  
  87.      There are several disadvantages to using the overlay planes, so menus
  88.      should be put there only when the advantages outweigh the disadvantages:
  89.  
  90.           The colormap in the overlay planes may have fewer pixels.  On some
  91.           hardware, the deepest overlay only has three color entries.  (The
  92.           fourth entry is a transparent pixel.)  When there are fewer colors
  93.           available, menus in the overlay planes have a different appearance.
  94.           In that case, if you have items in your pulldown menus other than
  95.           labels (e.g. cascade buttons or toggle buttons), they may not look
  96.           correct in some of the less-common color schemes.
  97.  
  98.           Other applications that are using the overlay planes at the same
  99.           time will display in the wrong colors when a menu appears (i.e.
  100.           colors will flash).  This happens because the menu's colormap will
  101.           get installed and replace any previous overlay colormap.
  102.  
  103.           When a pulldown menu in the overlay planes is torn off, 4Dwm puts
  104.           the tear-off in the overlay planes.  The title bar of the window
  105.           appears with the wrong colors and, as with (2), the window appears
  106.           with the wrong colors when another application uses the overlay
  107.           planes (e.g. 4Dwm's root-window popup menu).
  108.  
  109.      Running the example program "vkmenu" shows that the expose counter
  110.      increments each time a menubar item is selected and dismissed.  Running
  111.      "vkmenu -useOverlayMenus" shows that the expose counter does not change
  112.      when pulldown menus appear and disappear, since no expose events are
  113.      generated.  For more information see /_u_s_r/_s_h_a_r_e/_s_r_c/_V_i_e_w_K_i_t/_M_e_n_u_s/_R_E_A_D_M_E.
  114.  
  115.  
  116. FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNSSSS
  117.    VVVVkkkkSSSSuuuubbbbMMMMeeeennnnuuuu(((())))
  118.            VkSubMenu(const char *name,
  119.                      VkMenuDesc *desc = NULL,
  120.                      XtPointer   defaultClientData = NULL);
  121.  
  122.            VkSubMenu(Widget      parent,
  123.                      const char *name,
  124.                      VkMenuDesc *desc = NULL,
  125.                      XtPointer   defaultClientData = NULL);
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. VVVVkkkkSSSSuuuubbbbMMMMeeeennnnuuuu((((3333xxxx))))                                                    VVVVkkkkSSSSuuuubbbbMMMMeeeennnnuuuu((((3333xxxx))))
  137.  
  138.  
  139.  
  140.           The VkSubMenu constructor initializes a VkSubMenu object. If the
  141.           second form, which takes a widget as the first argument, is used,
  142.           the widgets used in the menu are built immediately. Otherwise, the
  143.           widgets in the menu are created at some later time.  Both forms of
  144.           the constructor support a defaultClientData argument which can be
  145.           used to supply a clientData argument for use with menu items added
  146.           to the pane whose callbacks do not specify clientData. This allows
  147.           menus to be specified statically, while still allowing an instance
  148.           pointer to be used with callbacks. Both forms of the constructor
  149.           also accept an optional array of VkMenuDesc structures that
  150.           statically describe the contents of the menu.
  151.  
  152.           It is seldom necessary to directly create a VkSubMenu object.
  153.           SubMenus can be added to any VkMenuBar, VkPopupMenu, or VkSubMenu by
  154.           calling those classes's addSubmenu() member function. Menu panes can
  155.           also be added to a VkWindow by calling VkWindow::addMenuPane().
  156.  
  157.    ~~~~VVVVkkkkSSSSuuuubbbbMMMMeeeennnnuuuu(((())))
  158.            virtual ~VkSubMenu()
  159.  
  160.  
  161.           Frees all memory allocated by the VkSubMenu class and destroys all
  162.           widgets used by this class. If the VkSubMenu object contains other
  163.           VkMenuItem objects, these objects are deleted.
  164.  
  165.    TTTTeeeeaaaarrrr OOOOffffffff CCCCoooonnnnttttrrrroooollll
  166.            void showTearOff(Boolean showit);
  167.  
  168.  
  169.           This function allows applications to specify whether or not a given
  170.           menu pane has a tear-off control.
  171.  
  172.    mmmmeeeennnnuuuuTTTTyyyyppppeeee(((())))
  173.            virtual VkMenuItemType menuType()
  174.  
  175.  
  176.           Returns VkMenuItem::SUBMENU.
  177.  
  178.    ppppuuuullllllllddddoooowwwwnnnn(((())))
  179.            Widget pulldown()
  180.  
  181.  
  182.           This function provides access to the XmRowColumn widget used to
  183.           implement the pulldown menu pane. The baseWidget() method returns
  184.           the XmCascadeButton widget required by Motif pulldown menus.
  185.  
  186.    ccccllllaaaassssssssNNNNaaaammmmeeee(((())))
  187.            virtual const char *classname()
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. VVVVkkkkSSSSuuuubbbbMMMMeeeennnnuuuu((((3333xxxx))))                                                    VVVVkkkkSSSSuuuubbbbMMMMeeeennnnuuuu((((3333xxxx))))
  203.  
  204.  
  205.  
  206.           Returns "VkSubMenu".
  207.  
  208. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  209.      The following code segment creates a VkPopupMenu object and adds two
  210.      cascading menu panes to the popup menu.
  211.  
  212.  
  213.            VkPopupMenu *popup = new VkPopupMenu("popupMenu");
  214.            VkSubMenu *subMenu1 = popup->addSubmenu("Submenu1");
  215.            VkSubMenu *subMenu2 = popup->addSubmenu("Submenu2");
  216.  
  217.            // add items to submenus here
  218.  
  219.  
  220.      The following code segment is a constructor for a subclass of VkWindow.
  221.      This constructor adds two panes to the VkWindow object's menu bar.
  222.  
  223.  
  224.            MyWindow::MyWindow( const char *name) :
  225.                         VkWindow( name)
  226.            {
  227.               Widget label =  XmCreateLabel(mainWindowWidget(),
  228.                                             "menuDemo", NULL, 0);
  229.  
  230.               VkSubMenu *appMenuPane = addMenuPane("Application");
  231.  
  232.               appMenuPane->addAction("Open",
  233.                                       &MyWindow::openCallback,
  234.                                       (XtPointer) this);
  235.               appMenuPane->addSeparator();
  236.               appMenuPane->addAction("Quit",
  237.                                       &MyWindow::quitCallback,
  238.                                      (XtPointer) this);
  239.  
  240.               // Add a second menu pane
  241.  
  242.               VkSubMenu *editMenuPane = addMenuPane("Edit");
  243.  
  244.               editMenuPane->addAction("copy",
  245.                                        &MyWindow::copyCallback,
  246.                                        (XtPointer) this);
  247.               editMenuPane->addAction("cut",
  248.                                        &MyWindow::cutCallback,
  249.                                        (XtPointer) this);
  250.               editMenuPane->addAction("paste",
  251.                                        &MyWindow::pasteCallback,
  252.                                        (XtPointer) this);
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. VVVVkkkkSSSSuuuubbbbMMMMeeeennnnuuuu((((3333xxxx))))                                                    VVVVkkkkSSSSuuuubbbbMMMMeeeennnnuuuu((((3333xxxx))))
  269.  
  270.  
  271.  
  272. IIIINNNNHHHHEEEERRRRIIIITTTTEEEEDDDD MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS
  273.    IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm VVVVkkkkMMMMeeeennnnuuuu
  274.           isContainer(), addAction(), addActionWidget(),
  275.           addConfirmFirstAction(), addSeparator(), addLabel(), addToggle(),
  276.           add(), addSubmenu() addRadioSubmenu(), registerSubmenu(),
  277.           findNamedItem(), removeItem(), deactivateItem(), replace(),
  278.           getItemPosition(), operator[](), numItems(),
  279.  
  280.  
  281.    IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm VVVVkkkkMMMMeeeennnnuuuuIIIItttteeeemmmm
  282.           show(), hide(), manageAll(), setLabel(), setPosition(), activate(),
  283.           deactivate(), remove(), show(), _position, _isBuilt, _sensitive,
  284.           _parentMenu, _label, _isHidden, _unmanagedWidgets,
  285.           _numUnmanagedWidgets,
  286.  
  287.  
  288.    IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm VVVVkkkkCCCCoooommmmppppoooonnnneeeennnntttt
  289.           installDestroyHandler(), removeDestroyHandler(), widgetDestroyed(),
  290.           setDefaultResources(), getResources(), manage(), unmanage(),
  291.           baseWidget(), okToQuit(), _name, _baseWidget, _w, deleteCallback
  292.  
  293.  
  294.    IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm VVVVkkkkCCCCaaaallllllllbbbbaaaacccckkkkOOOObbbbjjjjeeeecccctttt
  295.           callCallbacks(), addCallback(), removeCallback(),
  296.           removeAllCallbacks()
  297.  
  298.  
  299. KKKKNNNNOOOOWWWWNNNN DDDDEEEERRRRIIIIVVVVEEEEDDDD CCCCLLLLAAAASSSSSSSSEEEESSSS
  300.      VkHelpPane, VkRadioSubMenu,
  301.  
  302. CCCCLLLLAAAASSSSSSSSEEEESSSS UUUUSSSSEEEEDDDD BBBBYYYY TTTTHHHHIIIISSSS CCCCLLLLAAAASSSSSSSS
  303.      VkMenuItem
  304.  
  305. KKKKNNNNOOOOWWWWNNNN CCCCLLLLAAAASSSSSSSSEEEESSSS TTTTHHHHAAAATTTT UUUUSSSSEEEE TTTTHHHHIIIISSSS CCCCLLLLAAAASSSSSSSS
  306.      VkMenu, VkMenuBar
  307.  
  308. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  309.      VkMenu, VkMenuItem, VkComponent, VkMenu, VkMenuBar, VkMenuItem
  310.      _V_i_e_w_K_i_t _P_r_o_g_r_a_m_m_e_r'_s _G_u_i_d_e
  311.      _T_h_e _X _W_i_n_d_o_w _S_y_s_t_e_m, DEC Press, Bob Sheifler and Jim Gettys
  312.      _T_h_e _X _W_i_n_d_o_w _S_y_s_t_e_m _T_o_o_l_k_i_t, DEC Press, Paul Asente and Ralph Swick
  313.      _T_h_e _O_S_F/_M_o_t_i_f _P_r_o_g_r_a_m_m_e_r_s _R_e_f_e_r_e_n_c_e, Prentice Hall, OSF
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.